<?php

class ControllerTestCase extends Zend_Test_PHPUnit_ControllerTestCase
{
    protected $_application;
    
    protected $_includePath;

    public function setUp()
    {
        $this->_includePath = get_include_path();
        $this->bootstrap = array(
            $this, 'appBootStrap'
        );
        parent::setUp();
    }
    
    public function tearDown()
    {
        parent::tearDown();
        set_include_path($this->_includePath);
        Zend_Registry::getInstance()->exchangeArray(array());
    }

    public function appBootStrap()
    {
        $this->_application = new Zend_Application(
            APPLICATION_ENV,
            APPLICATION_PATH . '/configs/application.ini'
        );
        $this->_application->bootstrap();
        $this->frontController->setParam('bootstrap', $this->_application->getBootstrap());
    }
}